//测试-B+树
//编译：g++ TestBPlusTree.cpp ../../*/*/BPlusTree.hpp -o test
#ifndef __TESTBPLUSTREE__CPP
#define __TESTBPLUSTREE__CPP

#include<iostream>
#include"../../DataStructure/Tree/BPlusTree.hpp"

using namespace std;
using namespace NgSiuKei;

int main(void) {
    const int num = 9;
    // int data[num] = {7,6,5,4,3,2,1};//输出结果是错的
    int data[num];
    for(int i=0; i<num; ++i) {
        data[i] = i+1;
    }
    b_tree_node<int> *tree = createBPlusTree(data, num, 3);
    // cout << "[From Main]-[" << tree << ']' << endl;
    printBPlusTree(tree);
    cout << "=============" << endl;

    int val;
    cout << "====删除：";
    cin >> val;
    bool result = deleteValFromBPlusTree(tree, val);
    if(result) {
        printBPlusTree(tree);
        cout << "=============" << endl;
    }
    else {
        cout << "删除失败" << endl;
    }

    deleteBTree(tree);

    return 0;
}

#endif